<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<!-- checkbox标签 使用ognl表达式初始化 -->
checkbox标签：<br>
<!-- 使用struts的set标签将值存入缓存对象中 -->
<s:set name="myLists" value="{'小明','222','fff'}"></s:set>
<s:set name="mapSets" scope="session" value="#{'':'',1:'瑜珈用品',2:'户外用品',3:'球类',4:'自行车'}"></s:set>
<!-- value指定的是默认选中的值 -->
<s:checkboxlist name="uuu" list="#attr.myLists" value="{'fff'}"></s:checkboxlist>
<hr>
<s:checkboxlist name="list" list="{'Java','.Net','RoR','PHP'}" value="{'Java','.Net'}"/>
<hr>
<s:checkboxlist name="map" list="#{1:'瑜珈用品',2:'户外用品',3:'球类',4:'自行车'}" listKey="key" listValue="value" value="{1,2,3}"/>
<hr>
<s:select name="map" list="#attr.mapSets" listKey="key" listValue="value" value=""/>
<hr>
<s:iterator value="#attr.myLists" var="eachVal" status="st">
<s:property value="#st.index+1"/> -- <s:property value="eachVal"/>
</s:iterator>
<hr>
<s:iterator value="#attr.mapSets" var="eachVal" status="st">
<s:property value="#st.index+1"/> -- <s:property value="key"/>:<s:property value="value"/>
</s:iterator>
</body>
</html>